import time
from selenium import webdriver

driver=webdriver.Chrome()
driver.get("https://www.baidu.com/")

element = driver.find_element('id', 'kw')
# 找到一个元素
js = 'arguments[0].setAttribute("style", arguments[1]);'

style = 'background: red; border: 2px solid yellow;'
driver.execute_script(js, element, style)
# execute_script()方法一次可以传入多个参数
page_height = driver.execute_script('return document.documentElement.scrollHeight;')
print(page_height)

time.sleep(5)
driver.quit()